<?php

namespace App\Models;

use App\Enums\MiniAPP\TableReserveStatus;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class FakeTableReserve extends Model
{
    use HasFactory, SoftDeletes;

    protected $fillable = [
        'fake_table_type_id', 'member_id', 'name', 'phone', 'people_count',
        'need_assistant', 'date', 'time', 'status', 'store_id',
    ];

    protected $casts = [
        'need_assistant' => 'boolean',
        'status' => TableReserveStatus::class,
    ];

    public function tableType()
    {
        return $this->belongsTo(FakeTableType::class, 'fake_table_type_id');
    }

    public function member()
    {
        return $this->belongsTo(Member::class);
    }

    public function store()
    {
        return $this->belongsTo(Store::class);
    }
}
